package com.gec.zhs.entity.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gec.zhs.entity.enums.DateTimePatternEnum;
import com.gec.zhs.utils.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * @author zhs
 * @version 1.0
 * @date 2025-01-06
 * @description 评论
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class VideoComment implements Serializable {


    /**
     * 评论ID
     */
    private Integer commentId;

    /**
     * 父级评论ID
     */
    private Integer pCommentId;

    /**
     * 视频ID
     */
    private String videoId;

    /**
     * 视频用户ID
     */
    private String videoUserId;

    /**
     * 回复内容
     */
    private String content;

    /**
     * 图片
     */
    private String imgPath;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 回复人ID
     */
    private String replyUserId;

    /**
     * 0:未置顶  1:置顶
     */
    private Integer topType;

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date postTime;

    /**
     * 点赞数量
     */
    private Integer likeCount;

    /**
     * 踩数量
     */
    private Integer hateCount;

    /**
     * 视频评论
     */
    private List<VideoComment> children;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 回复人的昵称
     */
    private String replyNickName;

    /**
     * 回复人的头像
     */
    private String replyAvatar;

    /**
     * 视频名称
     */
    private String videoName;

    /**
     * 视频内容
     */
    private String videoCover;

    @Override
    public String toString() {
        return "评论ID:" + (commentId == null ? "空" : commentId) + "，父级评论ID:" + (pCommentId == null ? "空" : pCommentId) + "，视频ID:" + (videoId == null ? "空" : videoId) +
                "，视频用户ID:" + (videoUserId == null ? "空" : videoUserId) + "，回复内容:" + (content == null ? "空" : content) + "，图片:" + (imgPath == null ? "空" : imgPath) +
                "，用户ID:" + (userId == null ? "空" : userId) + "，回复人ID:" + (replyUserId == null ? "空" : replyUserId) + "，0:未置顶  1:置顶:" + (topType == null ? "空" : topType) + "，发布时间:" + (postTime == null ? "空" : DateUtil.format(
                postTime,
                DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern())) + "，喜欢数量:" + (likeCount == null ? "空" : likeCount) + "，讨厌数量:" + (hateCount == null ? "空" : hateCount);
    }
}
